<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>二手交易网</title>
	<link rel="stylesheet" href="css/myCss.css">
	<link rel="icon" href="img/school.jpg">
</head>
<body>
	<c:if test="${empty requestScope.pageBean.page}">
		<script>
			self.location='${pageContext.request.contextPath}/index?page=1';
		</script>
	</c:if>

	<div class="nav">
		<a href="index">二手交易网</a>
		<c:if test="${empty sessionScope.user }">
			<a href="login.jsp">登陆</a>
			<a href="register.jsp">注册</a>
		</c:if>
	</div>

	<div class="memu">
		<a href="index"><div class="memuAll">所有宝贝</div></a><a href="Upload.jsp"><div class="memuNormal">上架商品</div></a><a href="goodsTradeInf"><div class="memuNormal">交易信息</div></a>
	</div>

	<!-- 货物开始 -->
	<div class="AllGoods">
		<c:forEach items="${requestScope.pageBean.list}" var="goods">
			<div class="goods">
				<div class="pic">
					<a href="${pageContext.request.contextPath}/trade?goods.goodsId=${goods.goodsId}" style="background-image: url(${goods.goodsImageAddress})"></a>
				</div>
				<div class="price">￥${goods.goodsValue}</div>
				<div class="goodsname">
					<a class="title" href="${pageContext.request.contextPath}/trade?goods.goodsId=${goods.goodsId}">
						<span class="s-icon">包邮</span>
							${goods.goodsName}
					</a>
				</div>
				<div class="seller">
					<span class="bars">
						<span class="bar"></span>
						<span class="bar"></span>
						<span class="bar"></span>
					</span><span class="sellerName">${goods.sellerName}</span>
				</div>
				<div class="icon">
					<!--<span class="sixsixsix">666</span>-->
					<span class="school"></span>
				</div>
			</div>
		</c:forEach>
	</div>

	<%--导航--%>
	<div class="pageChange">
		<a href='${pageContext.request.contextPath}/index?page=1' class="BeginEndOr">首页</a>

		<c:if test="${requestScope.pageBean.page!= 1}">
			<a href='${pageContext.request.contextPath}/index?page=${requestScope.pageBean.page-1}' class="UpOrDown">上一页</a>
		</c:if>

		<c:forEach var="i" begin="${requestScope.pageBean.start}" end="${requestScope.pageBean.end}">
			<c:if test="${i!=requestScope.pageBean.page}">
				<a href='${pageContext.request.contextPath}/index?page=${i}' class="page">${i}</a>
			</c:if>
			<c:if test="${i==requestScope.pageBean.page}">
				<span class="active">${i}</span>
			</c:if>
		</c:forEach>

		<c:if test="${requestScope.pageBean.page!= requestScope.pageBean.totalPage}">
			<a href='${pageContext.request.contextPath}/index?page=${requestScope.page+1}' class="UpOrDown">下一页</a>
		</c:if>

		<a href='${pageContext.request.contextPath}/index?page=${requestScope.pageBean.totalPage}' class="BeginEndOr">尾页</a>
	</div>
</body>
</html>